package com.tianji.promotion.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.promotion.domain.po.Coupon;
import org.apache.ibatis.annotations.Update;

/**
* @author Cammy
* @description 针对表【coupon(优惠券的规则信息)】的数据库操作Mapper
* @createDate 2025-02-25 05:58:13
* @Entity generator.domain.Coupon
*/
public interface CouponMapper extends BaseMapper<Coupon> {

    @Update("update coupon set issue_num = issue_num + 1 where id = #{couponId} and issue_num < total_num")
    int incrIssueNum(Long id);
}




